#28 ✓invalid
Sean Dague

symbolic timezones don't work with tzinfo

Reported by Sean Dague | January 10th, 2010 @ 07:13 PM

The documentation implies that including tzinfo will allow time zones like "America/New_York" to function. However, this simple test script explodes when trying to access the date field.


!/usr/bin/ruby

require "pp"
require "rubygems"
require "tzinfo"
require "ri_cal"
require "open-uri"

open("http://mhvlug.org/calendar/ical") do |file|

@@cal = RiCal.parse(file)

end

pp @@cal.first.events.last.dtstart

The exception is as follows:

/var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/component/calendar.rb:155:in find_timezone': "America/New_York" is not the identifier of a VTIMEZONE component of this calendar (RiCal::InvalidTimezoneIdentifier)

from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/component.rb:67:in `find_timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:27:in `find_timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:32:in `timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:61:in `rational_tz_offset'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time.rb:304:in `ruby_value'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/properties/event.rb:134:in `dtstart'
from ./riparse.rb:13

Comments and changes to this ticket

  • Rick DeNatale

    Rick DeNatale January 10th, 2010 @ 08:01 PM

    • State changed from “new” to “invalid”

    RiCal only uses TZInfo to create calendars.

    The ical file provided is invalid because contrary to RFC 2445 it does not contain VTIMEZONE components sufficient to resolve all (actually in this case any) of the times with timezones within the file.

    This is a bug in whatever software produced that file. (The drupal calendar api according to the product id), not in RiCal.

  • Sean Dague

    Sean Dague January 10th, 2010 @ 08:15 PM

    Ok, I misread the documentation, and thought ri_cal supported this. I'll continue to use icalendar.rb then as it works fine with the drupal ical feeds.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences

Shared Ticket Bins

People watching this ticket

Pages